package counter;
import static org.junit.Assert.assertEquals;

import org.junit.Before;
import org.junit.Test;

import testharness.ConcurrentHarness;

public class TestSyncCounter extends ConcurrentHarness {

	private SyncCounter counter;

	@Before
	public void initCounter() {
		counter = new SyncCounter();
	}
		
	@Test
	public void testSyncCounter() {
		submitTasks();
	}

	@Override
	protected Runnable newTask() {
		return new Runnable() {
			@Override public void run() {counter.increment();}
		};
	}

	public void checkResults(){
		assertEquals(CYCLES, counter.getCounter());
	}
	
}
